#include <stdio.h>
#include <signal.h>

void handler(int sig)
{
	printf("get a signal:%d\n",sig);
}

int main()
{
	struct sigaction act,oact;
	act.sa_flags=0;
	act.sa_handler=handler;
	
	sigemptyset(&act.sa_mask);
	sigaction(2,&act,&oact);//捕获二号进程
	return 0;
}
